using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class OperationMap : EntityTypeConfiguration<Operation>
    {
        public OperationMap()
        {
            // Primary Key
            this.HasKey(t => t.OPT_ID);

            // Properties
            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Stenting_way)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Pretreatment_methods)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Name)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Diameter)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Length)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Expansion_pressure)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Expansion_time)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Expansion_Num)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_Factory)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Balloon_not_place)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.OPT_Other_pretreatment)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Rotablator_Diameter)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Max_Num_Revolutions)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Rotablator_Views)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Peeling_Flexi_Cut)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Peeling_Max_Pressure)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Number_times)
                .HasMaxLength(50);

            this.Property(t => t.OPT_QCA_Stenosis)
                .HasMaxLength(50);

            this.Property(t => t.OPT_QCA_Stenosis_detail)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Min_Lumen_diameter)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Min_Lumen_diameter_detail)
                .HasMaxLength(50);

            this.Property(t => t.OPT_Whether_series_bracket)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Stents_total_length)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Stents_total_length_detail)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Stent_after_expansion)
                .HasMaxLength(20);

            this.Property(t => t.OPT_SAE_Name)
                .HasMaxLength(20);

            this.Property(t => t.OPT_SAE_Factory)
                .HasMaxLength(20);

            this.Property(t => t.OPT_SAE_Balloon_not_place)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.OPT_Intravascular_radiation_therapy)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Using_IVUS)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Kissing_Balloon_Technology)
                .HasMaxLength(20);

            this.Property(t => t.OPT_KissingBalloon_before_or_after)
                .HasMaxLength(20);

            this.Property(t => t.OPT_bifurcation_lesions_stent_technology)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Application_float_stent_technology)
                .HasMaxLength(20);

            this.Property(t => t.OPT_Application_IABP)
                .HasMaxLength(20);

            this.Property(t => t.OPT_IsStenting)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.OPT_Balloon)
                .HasMaxLength(20);

            this.Property(t => t.OPT_OtheValue)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Operation");
            this.Property(t => t.OPT_ID).HasColumnName("OPT_ID");
            this.Property(t => t.TTL_ID).HasColumnName("TTL_ID");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.OPT_Stenting_way).HasColumnName("OPT_Stenting_way");
            this.Property(t => t.OPT_Pretreatment_methods).HasColumnName("OPT_Pretreatment_methods");
            this.Property(t => t.OPT_Balloon_Name).HasColumnName("OPT_Balloon_Name");
            this.Property(t => t.OPT_Balloon_Diameter).HasColumnName("OPT_Balloon_Diameter");
            this.Property(t => t.OPT_Balloon_Length).HasColumnName("OPT_Balloon_Length");
            this.Property(t => t.OPT_Balloon_Expansion_pressure).HasColumnName("OPT_Balloon_Expansion_pressure");
            this.Property(t => t.OPT_Balloon_Expansion_time).HasColumnName("OPT_Balloon_Expansion_time");
            this.Property(t => t.OPT_Balloon_Expansion_Num).HasColumnName("OPT_Balloon_Expansion_Num");
            this.Property(t => t.OPT_Balloon_Factory).HasColumnName("OPT_Balloon_Factory");
            this.Property(t => t.OPT_Balloon_not_place).HasColumnName("OPT_Balloon_not_place");
            this.Property(t => t.OPT_Other_pretreatment).HasColumnName("OPT_Other_pretreatment");
            this.Property(t => t.OPT_Rotablator_Diameter).HasColumnName("OPT_Rotablator_Diameter");
            this.Property(t => t.OPT_Max_Num_Revolutions).HasColumnName("OPT_Max_Num_Revolutions");
            this.Property(t => t.OPT_Rotablator_Views).HasColumnName("OPT_Rotablator_Views");
            this.Property(t => t.OPT_Peeling_Flexi_Cut).HasColumnName("OPT_Peeling_Flexi_Cut");
            this.Property(t => t.OPT_Peeling_Max_Pressure).HasColumnName("OPT_Peeling_Max_Pressure");
            this.Property(t => t.OPT_Number_times).HasColumnName("OPT_Number_times");
            this.Property(t => t.OPT_QCA_Stenosis).HasColumnName("OPT_QCA_Stenosis");
            this.Property(t => t.OPT_QCA_Stenosis_detail).HasColumnName("OPT_QCA_Stenosis_detail");
            this.Property(t => t.OPT_Min_Lumen_diameter).HasColumnName("OPT_Min_Lumen_diameter");
            this.Property(t => t.OPT_Min_Lumen_diameter_detail).HasColumnName("OPT_Min_Lumen_diameter_detail");
            this.Property(t => t.OPT_Whether_series_bracket).HasColumnName("OPT_Whether_series_bracket");
            this.Property(t => t.OPT_Stents_total_length).HasColumnName("OPT_Stents_total_length");
            this.Property(t => t.OPT_Stents_total_length_detail).HasColumnName("OPT_Stents_total_length_detail");
            this.Property(t => t.OPT_Stent_after_expansion).HasColumnName("OPT_Stent_after_expansion");
            this.Property(t => t.OPT_SAE_Name).HasColumnName("OPT_SAE_Name");
            this.Property(t => t.OPT_SAE_Diameter).HasColumnName("OPT_SAE_Diameter");
            this.Property(t => t.OPT_SAE_Length).HasColumnName("OPT_SAE_Length");
            this.Property(t => t.OPT_SAE_Expansion_pressure).HasColumnName("OPT_SAE_Expansion_pressure");
            this.Property(t => t.OPT_SAE_Expansion_time).HasColumnName("OPT_SAE_Expansion_time");
            this.Property(t => t.OPT_SAE_Expansion_Num).HasColumnName("OPT_SAE_Expansion_Num");
            this.Property(t => t.OPT_SAE_Factory).HasColumnName("OPT_SAE_Factory");
            this.Property(t => t.OPT_SAE_Balloon_not_place).HasColumnName("OPT_SAE_Balloon_not_place");
            this.Property(t => t.OPT_Intravascular_radiation_therapy).HasColumnName("OPT_Intravascular_radiation_therapy");
            this.Property(t => t.OPT_Using_IVUS).HasColumnName("OPT_Using_IVUS");
            this.Property(t => t.OPT_Kissing_Balloon_Technology).HasColumnName("OPT_Kissing_Balloon_Technology");
            this.Property(t => t.OPT_KissingBalloon_before_or_after).HasColumnName("OPT_KissingBalloon_before_or_after");
            this.Property(t => t.OPT_bifurcation_lesions_stent_technology).HasColumnName("OPT_bifurcation_lesions_stent_technology");
            this.Property(t => t.OPT_Application_float_stent_technology).HasColumnName("OPT_Application_float_stent_technology");
            this.Property(t => t.OPT_Application_IABP).HasColumnName("OPT_Application_IABP");
            this.Property(t => t.OPT_IsStenting).HasColumnName("OPT_IsStenting");
            this.Property(t => t.OPT_Balloon).HasColumnName("OPT_Balloon");
            this.Property(t => t.OPT_OtheValue).HasColumnName("OPT_OtheValue");
        }
    }
}
